package com.suineg.pms.service.base;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.google.common.collect.Lists;
import com.suineg.pms.entity.base.Paking;
import com.suineg.pms.repository.base.PakingDao;

/**
 *
 *@author Suine
 */
@Service
@Transactional(readOnly = true)
public class PakingService {
	/** 日志输出对象 */
	protected final Logger logger = LoggerFactory.getLogger(getClass());
	@Autowired
	private PakingDao dao;
	
	public Paking get(Long id){
		return dao.findOne(id);
	}
	
	public List<Paking> findAll(){
		return Lists.newArrayList(dao.findAll());
	}
	
	@Transactional(readOnly = false)
	public void save(Paking paking){
		dao.save(paking);
	}
	
	@Transactional(readOnly = false)
	public void delete(Long id){
		dao.delete(id);
	}
	
	public Paking findByNo(String no){
		return dao.findByNo(no);
	}

}

